package cmdline

import "strings"

type CmdInfo struct {
	Cmd string
	Args []string
}

func NewCmdInfo(text string) *CmdInfo {
	s := &CmdInfo{
		Cmd: "",
		Args: make([]string, 0),
	}
	cs :=strings.Split(text, " ")
	if len(cs) > 0 {
		s.Cmd = cs[0]
		if len(cs) > 1 {
			s.Args = cs[1:]
		}
	}
	return s
}